package com.vegetable.modules.service.baseData.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vegetable.common.utils.PageUtils;
import com.vegetable.common.utils.Query;
import com.vegetable.modules.entity.baseData.StallsClauses;
import com.vegetable.modules.mapper.baseData.StallsClausesMapper;
import com.vegetable.modules.service.baseData.IStallsClausesService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 客商-费用明细表 服务实现类
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-07
 */
@Slf4j
@Service
@AllArgsConstructor
public class StallsClausesServiceImpl extends ServiceImpl<StallsClausesMapper, StallsClauses> implements IStallsClausesService {

    /**
     * 客商的费用明细
     * @param params
     * @return
     */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<StallsClauses> page = this.page(
                new Query<StallsClauses>().getPage(params),
                new QueryWrapper<StallsClauses>()
                        .eq(ObjectUtils.isNotEmpty(params.get("stallsId")),"stalls_id", params.get("stallsId"))
        );

        return new PageUtils(page);
    }
}
